﻿//-----------------------------------------------------------------------
// <copyright file="StringUtility.cs">
//     Copyright (c) Nicole Calinoiu. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using System.Text;

namespace Bordecal.FxCop.Sdk
{
	[SuppressMessage("Microsoft.StyleCop.CSharp.DocumentationRules", "SA1600:ElementsMustBeDocumented",
			Justification = "False positive.")]
	internal static class StringUtility
	{
		internal static T ToEnum<T>(this string value)
		{
			if (value == null)
			{
				throw new ArgumentNullException("value");
			}

			return (T)Enum.Parse(typeof(T), value);
		}
	}
}